<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 同步,异步 的方法
    let arr = [10,20,30]
    console.log(1);

    // arr.forEach((item) => {
    //   console.log(item);
    // })

    let add = () => {
      console.log("add");
    }

    setTimeout(() => {
      console.log(10);
      add()
    }, 0);



    console.log(2);

    // 1,2,10,20,30

    1,10,20,30,2

  </script>
</body>
</html>